import Cookies from 'js-cookie'

const TokenKey = 'vue_admin_template_token'
const DEFAULT_DUR = 1 // cookie存储时长， 单位 天

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token, duration) {
  return Cookies.set(TokenKey, token, { expires: duration || DEFAULT_DUR })
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}
